/**
Date: 2025-08-13
Copyright (c) 2025 Industrial Software Feature Database
*/
import request from '@/utils/request';
import request2 from '@/utils/request2';
// 生成标准装机清单
export const uploadStandardListData = (aircraftModel: string, data: FormData) => {
  return request({
    url: `/biz/bom/bom-generate/BOM/${aircraftModel}`,
    method: 'post',
    data: data,
    headers: {
      'Content-type': 'multipart/form-data'
    }
  });
};
// 上传初始化记录
export const uploaInitRecordData = (aircraftModel: string, data: FormData) => {
  return request({
    url: `/biz/bom/upload-init/${aircraftModel}`,
    method: 'post',
    data: data,
    headers: {
      'Content-type': 'multipart/form-data'
    }
  });
};
// 分页查询标准装机清单明细
export const getStandardDetailList = (query) => {
  return request({
    url: `biz/bom/bom-detail/standard/${query.aircraftModel}`,
    method: 'get',
    params: query
  });
};
// 分页查询标准装机清单文件列表
export const getStandardList = (query) => {
  return request({
    url: `/biz/bom/list-bom/${query.aircraftModel}`,
    method: 'get',
    params: query
  });
};
// 生成清单
export const generateList = (data) => {
  return request({
    url: `/biz/bom/bom-generate/${data.aircraftModel}`,
    method: 'post',
    data: data
  });
};
// 导出
export const downloadData = (data) => {
  const obj = { ...data };
  delete obj.aircraftModel;
  return request2({
    url: `/biz/bom/bom-export/SBOM/${data.aircraftModel}`,
    method: 'post',
    params: obj,
    responseType: 'blob'
  });
};
// 分页查询批次号列表
// export const getTrackList = (aircraftModel, data) => {
//   return request({
//     url: `/biz/bom/list-track/${aircraftModel}`,
//     method: 'get',
//     params: data
//   });
// };
// 分页查询批次号列表
export const getTrackList = (aircraftModel, data) => {
  return request({
    url: `/biz/bom/list-track-info/${aircraftModel}`,
    method: 'get',
    params: data
  });
};
//修改标准装机清单明细
export const deleteStandardDetail = (aircraftModel, id, deleteIds) => {
  return request({
    url: `/biz/bom/bom-detail/standard/${aircraftModel}/${id}`,
    method: 'put',
    data: { deleteIds }
  });
};
//*******************************V2*********************************************** */
// 查询所有批次号信息V2
export const getTrackListV2 = (data?) => {
  return request({
    url: `/biz/bom-v2/list/all-track-info`,
    method: 'get',
    params: data
  });
};
// 分页查询标准装机清单列表V2
export const getStandardListV2 = (data) => {
  return request({
    url: `/biz/bom-v2/list/standard`,
    method: 'get',
    params: data
  });
};
// 生成强度数模清单V2
export const generateStrengthV2 = (data) => {
  return request({
    url: `/biz/bom-v2/generate/strength`,
    method: 'post',
    data: data
  });
};
//构型定义
export const listTree = () => {
  return request({
    url: `/isfd/modelManagementStructureDefinitionTree/listTree`,
    method: 'get'
  });
};
// 上传原始装机清单V2
export const uploadInit = (data) => {
  return request({
    url: `/biz/bom-v2/upload/init`,
    method: 'post',
    data
  });
};
// 分页查询标准装机清单明细V2
export const detailStandardList = (data) => {
  return request({
    url: `/biz/bom-v2/detail/standard`,
    method: 'get',
    params: data
  });
};
// 导出标准装机清单V2
export const exportStandard = (data) => {
  return request2({
    url: `/biz/bom-v2/export/standard`,
    method: 'post',
    params: data,
    responseType: 'blob'
  });
};
// 修改拷贝标准装机清单V2
export const updateStandard = (data) => {
  return request2({
    url: `/biz/bom-v2/copy/standard`,
    method: 'post',
    data
  });
};
